package MD2Model;

/**
 * This class will define a vector, it include 3 field: x axis, y axis and z axis
 * 
 */
public class Vector3 {
	private float x;
	private float y;
	private float z;
	
	/**
	 * Constructor
	 */
	public Vector3 () {
	}
	
	public Vector3(int x, int y, int z){
		this.x = x;
		this.y = y;
		this.z = z;
	}
	
	/**
	 * Set value for each field
	 * @param x x value
	 * @param y y value
	 * @param z z value
	 */
	public void SetValue (float x, float y, float z){
		this.x = x;
		this.y = y;
		this.z = z;
	}
	
	/**
	 * 
	 * @return value of x axis
	 */
	public float GetX (){
		return x;
	}
	
	/**
	 * 
	 * @return value of y axis
	 */
	public float GetY (){
		return y;
	}
	
	/**
	 * 
	 * @return value of z axis
	 */
	public float GetZ (){
		return z;
	}
	
	public float SqrDistanceTo(Vector3 des){
		return ((des.GetX() - x)*(des.GetX() - x) + 
		(des.GetY() - y)*(des.GetY() - y) + 
		(des.GetZ() - z)*(des.GetZ() - z));
	}
	
	public static Vector3 Zero = new Vector3(0,0,0);
}
